package models

import (
	"time"

	"github.com/astaxie/beego/orm"
)

type Shop struct {
	Id         int
	Name       string     `desctiption:"商店名称" orm:"size(255);unique"`
	Longitude  string     `orm:"size(255)" description:"经度"`
	Latitude   string     `orm:"size(255)" description:"经度"`
	Desc       string     `orm:"type(text)" description:"介绍"`
	Image      string     `orm:"size(255)" description:"封面图"`
	Addr       string     `orm:"size(255)" description:"地址"`
	Phone      string     `orm:"size(255)" description:"手机号码"`
	CreateTime time.Time  `orm:"auto_now_add" description:"创建时间"`
	UpdateTime time.Time  `orm:"auto_now_add;auto_now" description:"更改时间"`
	Products   []*Product `orm:"reverse(many)" description:"商品"`
}

func init() {
	orm.RegisterModel(new(Shop))
}
